package com.caishi.lkx.order.model;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.zzw.common.entity.impl.BaseIntEntity;
import com.caishi.lkx.order.IAssetsModel;
import com.caishi.lkx.order.ienum.type.AssetsType;
import lombok.*;

import javax.validation.constraints.NotNull;

/**
 * @author by keray
 * date:2019/7/29 11:45
 */

@EqualsAndHashCode(callSuper = true)
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@TableName("or_order_detail")
public class OrderDetailModel extends BaseIntEntity<OrderDetailModel> {
    /**
     * 订单Id
     */
    private String orderId;

    /**
     * 订单详情商品类型
     */
    @NotNull
    private AssetsType entityType;

    /**
     * 实体外键
     */
    @NotNull
    private String entityId;

    /**
     * 数量
     */
    private Integer totalCount = 1;

    /**
     * 资产id
     */
    private Long userAssetId;

    @TableField(exist = false)
    private IAssetsModel<?, ?> assets;


    @TableField(exist = false)
    private UserAssetsDataModel assetsData;


}
